using System;
using System.Collections.Generic;
using System.Text;
using emp.Model;
using emp.IDAL;
using System.Collections;

namespace emp.BLL
{
    /// <summary>
    /// author      jtao
    /// date        2006.05.16
    /// </summary>
    public class CellType
    {
        /// <summary>
        /// A method to insert a new Account
        /// </summary>
        /// <param name="account">An account entity with information about the new account</param>
        public int Insert(CellTypeInfo myCellTypeInfo)
        {

            // Validate input
            if (myCellTypeInfo.CellTypeName.Trim() == string.Empty)
            {
                return 0;
            }
            // Get an instance of the account DAL using the DALFactory
            ICellType dal = emp.DALFactory.CellType.Create();

            // Call the DAL to insert the account
            return dal.Insert(myCellTypeInfo);
        }

        /// <summary>
        /// A method to update an existing account
        /// </summary>
        /// <param name="account">An account entity with information about the account to be updated</param>
        public int Update(CellTypeInfo myCellTypeInfo)
        {

            // Validate input
            if (myCellTypeInfo.CellTypeName.Trim() == string.Empty)
                return 0;

            // Get an instance of the account DAL using the DALFactory
            ICellType dal = emp.DALFactory.CellType.Create();

            // Send the udpated account information to the DAL
            return dal.Update(myCellTypeInfo);
        }

        public int Delete(int iCellTypeID)
        {

            // Validate input
            if (iCellTypeID < 0)
            {
                return 0;
            }

            // Get an instance of the account DAL using the DALFactory
            ICellType dal = emp.DALFactory.CellType.Create();

            // Send the udpated account information to the DAL
            return dal.Delete(iCellTypeID);
        }


        /// <summary>
        /// A method to get Cell types
        /// </summary>
        /// <param name="account">An account entity with information about the account to be updated</param>
        public IList getCellTypeList(String sIsDel)
        {


            // Get an instance of the account DAL using the DALFactory
            ICellType dal = emp.DALFactory.CellType.Create();

            // Send the udpated account information to the DAL
            return dal.getCellTypeList(sIsDel);
        }

        public IList getCellTypeInfo(String sIsDel, int iCellTypeID)
        {
            // Get an instance of the account DAL using the DALFactory
            ICellType dal = emp.DALFactory.CellType.Create();

            // Send the udpated account information to the DAL
            return dal.getCellTypeInfo(sIsDel, iCellTypeID);
        }
    }
}
